//
//  BaseMoedel.m
//  mintHome
//
//  Created by 朱彦名 on 16/6/20.
//  Copyright © 2016年 朱彦名. All rights reserved.
//

#import "BaseMoedel.h"

@implementation BaseMoedel

- (instancetype)initWithDic: (NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
        
    }
    return self;
    

}

+ (instancetype)modelWithDic: (NSDictionary *)dic{
    
    id m = [[[self class]alloc]initWithDic:dic];
    return m;
    
}
+ (NSMutableArray *)modelHandlerWithArray:(NSArray *)arr
{
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        id m = [[self class] modelWithDic:dic];
        [mArr addObject:m];
    }
    return mArr;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{

}

@end
